# define _CRT_SECURE_NO_WARNINGS
#include "SList.h"


void TestSList1()
{
	SListNode* plist=NULL;
	SLTPushBack(&plist, 1);
	PrintSList(plist);

	SLTPushBack(&plist, 2);
	PrintSList(plist);

	SLTPushBack(&plist, 3);
	PrintSList(plist);

	SLTPushBack(&plist, 4);
	PrintSList(plist);

	SLTPopBack(&plist);
	PrintSList(plist);

	SLTPopBack(&plist);
	PrintSList(plist);

	SLTPopBack(&plist);
	PrintSList(plist);

	SLTPopBack(&plist);
	PrintSList(plist);

}


void TestSList2()
{
	SListNode* plist = NULL;
	SLTPushFtont(&plist, 4);
	PrintSList(plist);

	SLTPushFtont(&plist, 3);
	PrintSList(plist);

	SLTPushFtont(&plist, 2);
	PrintSList(plist);

	SLTPushFtont(&plist, 1);
	PrintSList(plist);

	SLTPopFront(&plist);
	PrintSList(plist);

	SLTPopFront(&plist);
	PrintSList(plist);

	SLTPopFront(&plist);
	PrintSList(plist);

	SLTPopFront(&plist);
	PrintSList(plist);

}


void TestSList3()
{
	SListNode* plist = NULL;
	SLTPushBack(&plist, 1);
	PrintSList(plist);

	SLTPushBack(&plist, 2);
	PrintSList(plist);

	SLTPushBack(&plist, 3);
	PrintSList(plist);

	SLTPushBack(&plist, 4);
	PrintSList(plist);

	//SListNode* ret = SLTFind(plist,2);
	//ret->data *= 2;
	//PrintSList(plist);

	//SLTInsert(&plist, ret, 1);
	//PrintSList(plist);


	SListNode* ret = SLTFind(plist, 3);

	SLTInsertAfter(ret, 6);
	PrintSList(plist);
	
	SLTEraseAfter(&plist, ret);
	PrintSList(plist);

}



int main()
{
	TestSList3();
	return 0;
}